Add code to make handling domain poweroff/reboot symmetrical between
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 6 Apr 2006 14:24:00 +0000 (15:24 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 6 Apr 2006 14:24:00 +0000 (15:24 +0100)
commit66edd49a38a5f5eb57e12b1302adae2e7bc05594
tree6112ed44cf5988f92674017a5822a0d351ba05a1
parentf0a187ecb73186b1fbb7eae3fd0ba6ff8d602e1a
Add code to make handling domain poweroff/reboot symmetrical between
paravirtualized and fully virtualized.  This approach uses the new
sched_op to handle other domains than the current domain.  The new
code, SCHEDOP_remote_shutdown, is very much like SCHEDOP_shutdown, but
is called with the id of the domain which is to be shut down. This
allows fully virtualized shutdown and para-virtualized shutdown to be
identical from that point forward.

A paravirtualized domain uses sched_op to shut down and set the reason
code. This will send a VIRQ_DOM_EXC, which can be handled in dom0 by
control software.  In some ways, this resembles SIGCHILD/waitpid, and
is a reasonable model.

The fully virtualized case has qemu invoke xm directly. This is a
different path than paravirtualized. It also removes decision and
policy making choices from the rest of the control software and places
it within qemu. When any dom0 logic eventually gets a VIRQ_DOM_EXC,
the information about the domain is gone having been destroyed by xm.

A libxenctrl wrapper, xc_shutdown_domain has been added and qemu now
calls it.

As a freebie, #if 0 some very verbose logging code in qemu.  Totally
unrelated, but as long as I was there...

Signed-off-by: Ben Thomas <ben@virtualiron.com>
linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
tools/ioemu/target-i386-dm/helper2.c
tools/ioemu/vl.c
tools/libxc/xc_domain.c
tools/libxc/xenctrl.h
xen/common/schedule.c
xen/include/public/sched.h